package com.chixing.controller;

import com.chixing.service.MessageService;
import com.chixing.util.ServerResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class MessageController {
    @Autowired
    private MessageService messageService;
    @GetMapping("/message")
    public ModelAndView getAllMsg(){
        ServerResult result = messageService.getAllMsg ();
        ModelAndView mav = new ModelAndView ();
        mav.addObject ("MsgList",result.getData ());
        mav.setViewName ("customer/message_list");
        return mav;
    }
}
